<template>
  <keep-alive exclude="researcherList,researcherDetail">
    <component :is="componentName" :rowId="rowId" @change="changeComponent" />
  </keep-alive>
</template>

<script>
import researcherList from "./list.vue";
import researcherDetail from "./detail.vue";

export default {
  components: {
    researcherList,
    researcherDetail,
  },
  data() {
    return {
      componentName: "researcherList",
      rowId: "",
    };
  },
  methods: {
    changeComponent({ componentName, rowId }) {
      this.componentName = componentName;
      this.rowId = rowId;
    },
  },
};
</script>
